ENDED_JOB_INFO table function
The ENDED_JOB_INFO table function returns information about jobs that have ended. This information is gathered from CPF1164 messages recorded in the history log.
Authorization: See Note below.
- start-time
- A timestamp expression that indicates the starting timestamp to use for returning ended job
information.
If this parameter is omitted, the default of CURRENT DATE - 1 DAY is used.
- end-time
- A timestamp expression that indicates the ending timestamp to use for returning ended job
information.
If this parameter is omitted, the default of '9999-12-30-00.00.00.000000' is used.
Column Name | Data Type | Description |
---|---|---|
MESSAGE_TIMESTAMP | TIMESTAMP | The timestamp when the CPF1164 message was sent. |
FROM_USER | VARCHAR(10) | The user name of the job from which the CPF1164 message was sent. |
FROM_JOB | VARCHAR(28) | The qualified job name from which the CPF1164 message was sent. |
FROM_JOB_NAME | VARCHAR(10) | The name of the job from which the CPF1164 message was sent. |
FROM_JOB_USER | VARCHAR(10) | The user profile that started the job from which the CPF1164 message was sent. |
FROM_JOB_NUMBER | VARCHAR(6) | The job number of the job from which the CPF1164 message was sent. |
JOB_INTERFACE | VARCHAR(22) | The interface used by the job reported by the CPF1164 message.
|
FROM_PROGRAM | VARCHAR(10) | The program that sent the CPF1164 message. |
CPU_TIME | DECIMAL(15,3) | The total amount of processing used by the job, in seconds. |
NUMBER_OF_STEPS | SMALLINT | The number of routing steps used by the job. |
JOB_END_CODE | SMALLINT | The job end code.
|
JOB_END_DETAIL | VARCHAR(100) | Descriptive text corresponding to JOB_END_CODE. |
SECONDARY_ENDING_CODE | SMALLINT | The job's secondary ending code.
|
SECONDARY_ENDING_CODE_DETAIL | VARCHAR(100) | Descriptive text corresponding to SECONDARY_ENDING_CODE. |
JOB_ENTERED_SYSTEM_TIME | TIMESTAMP(0) | The time the job entered the system. Returns the null value if the value is not available. |
JOB_ACTIVE_TIME | TIMESTAMP(0) | The time the job started to run. Returns the null value if the value is not available. |
TOTAL_RESPONSE_TIME | INTEGER | The total response time for an interactive job. |
SUBSYSTEM | VARCHAR(10) | Subsystem where the job was run. |
INTERACTIVE_TRANSACTIONS | INTEGER | The total number of operator interactions, such as pressing the Enter key, for the job. |
SYNC_AUX_IO_COUNT | INTEGER | The number of synchronous (physical) disk I/O operations performed by the job. This value is the sum of the synchronous database and non-database reads and writes. |
JOB_TYPE | VARCHAR(11) | The type of job.
|
PEAK_TEMPORARY_STORAGE | INTEGER | The maximum temporary storage, in megabytes, used by the job. |
Note
This function is provided in the SYSTOOLS schema as an example of how to extract information from message substitution variables. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.
Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.
Example
SELECT FROM_USER, FROM_JOB, PEAK_TEMPORARY_STORAGE, JOB_ACTIVE_TIME
FROM TABLE (SYSTOOLS.ENDED_JOB_INFO() )
ORDER BY PEAK_TEMPORARY_STORAGE DESC
LIMIT 10;